package com.example.yk_lx.cons;

import androidx.lifecycle.MutableLiveData;

import com.example.yk_lx.baseMVVM.BaseRepo;
import com.hyphenate.chat.EMConversation;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

public class ConsRepo extends BaseRepo {
    public void getCons(MutableLiveData<List<EMConversation>> success,MutableLiveData<String> fail){
        Map<String, EMConversation> conversations = client.chatManager().getAllConversations();
        if(conversations!=null){
            success.postValue(new ArrayList<>(conversations.values()));
        }else{
            fail.postValue("获取失败");
        }
    }
}
